<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, inital-scale=1.0, maximum-scale=1.0, minimum=1.0, user-scalable=no">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.css"/>
<script src="http://code.jquery.com/jquery-1.4.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.js"></script>

<script language="JavaScript">
<!--
var contentFlag=true;
function regSns(){
		var content=document.getElementById('content').value;
		$.ajax({
				type:"POST",
				url:"<c:url value='/regSns.do'/>",
				data:"content="+content,
				success: function(){
					alert("success");
					history.back();
					},
				error: function(){alert("error");}
				});
	}
	
	function setContent(){
		if(contentFlag==true)
			document.getElementById('content').value="";
		contentFlag=false;
	}

//-->
</script>

<title>Mobile TEST SNS</title>
</head>
<body>
	<div data-role="page">
		<div data-theme="b" data-role="header">
			<div data-role="navbar">
			<ul>
				<li><a href="#" class="ui-btn-active ui-state-persist" >MY</a></li>
				<li><a href="#" >ANOTHER</a></li>
				<li><a href="#" >SETTING</a></li>
			</ul>
			</div>
		</div>
		
		<div data-role="content">
			<input tpye="text" style="width:96%;" value="input content" onclick="$('#linkDialog').click();" />
			<a style="display:none;" id="linkDialog" data-role="button" data-mini="true"  data-inline="true" href="regSnsPage.do" data-rel="dialog" data-transition="pop">Open dialog</a>
			<div class="ui-grid-a">
				<c:forEach items="${list}" var="list">
					<div class="ui-block-a">
					${list.sns_id} : ${list.sns_writer} : ${list.sns_wrtdate}
					<br>${list.sns_content} 
					</div>
				</c:forEach>
			</div>
		</div>
		
		<div data-theme="b" data-fullscreen="true" data-role="footer">
			<h1>mobile test sns</h1>
		</div>
	</div>
	
</body>
</html>